package com.example.springbootswagger2.common;


import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
public class RestResult<T> {
    @ApiModelProperty(example = "0")
    private Integer status;

    private T data;

    private String message;

    private RestResult() {}

    public static <T> RestResult<T> newInstance() {
        return new RestResult<>();
    }

    @Override
    public String toString() {
        return "RestResult{" +
                "result=" + status +
                ", data=" + data +
                ", message="+message+
                '}';
    }

}
